package com.wenjiang.factory;

import com.wenjiang.Interceptor.HttpInterceptor;
import com.wenjiang.Interceptor.HttpRequestRequiredInterceptor;
import com.wenjiang.Interceptor.HttpRequestSignInterceptor;
import com.wenjiang.config.LanTuPayProperties;
import lombok.extern.slf4j.Slf4j;

/**
 * @description: HttpRequestInterceptor http拦截工厂
 * @author：lwj
 * @date: 2024/12/2
 * @Copyright： 沉淀、分享、成长，让自己和他人都能有所收获！
 */
@Slf4j
public class HttpRequestInterceptorFactory {


    /**
     * 构建wx请求拦截的责任链
     * @param lanTuPayProperties
     * @return
     */
    public static HttpInterceptor buildLanTuWxPayHttpRequestInterceptor(LanTuPayProperties lanTuPayProperties){
         HttpRequestRequiredInterceptor httpRequestRequiredInterceptor = new HttpRequestRequiredInterceptor(lanTuPayProperties);
         HttpRequestSignInterceptor httpRequestSignInterceptor = new HttpRequestSignInterceptor(lanTuPayProperties);
         httpRequestRequiredInterceptor.appendNext(httpRequestSignInterceptor);
         return  httpRequestRequiredInterceptor;
     }
}
